/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

var tabRef = new Array();
var tabQuantity = new Array();
//var reg=/^\d+$/;
var reg= new RegExp("^[0-9]+$");

function addRequestProduct(idIf,line)
{
    elemSelected=eval('document.getElementById("'+idIf+'")');
    valueIf = parseInt(elemSelected.value);
    ta_quantity="";
    ta_UID=""; 
   
    tabRef[line]=idIf;
    if (valueIf <= 0){ 
        tabRef[line]="";
    }
    else{
        tabQuantity[line]=valueIf;
    }
     
    for(i=0;i<tabQuantity.length;i++)
    {
        if(tabQuantity[i] != "" && tabQuantity[i] != undefined)
        {
                
        ta_UID+=tabRef[i]+";";
        ta_quantity+=tabQuantity[i]+";";
        }       
    }
    document.getElementById("allQuantity").value=ta_quantity;
    document.getElementById("allRef").value=ta_UID;
}